open-with: cope with NULL GAppInfo
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 16 Nov 2010 14:13:11 +0000 (15:13 +0100)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 23 Nov 2010 15:51:38 +0000 (16:51 +0100)
It's not that the GAppInfo can actually be NULL, but we use the store to
save headings too, which have no GAppInfo in their rows.

gtk/gtkopenwithdialog.c

index bd3929aff11bc05df615d609f522f62f66ac4b9c..c0ad1203ddba052692bcf11a38d68b3531801b4a 100644 (file)
@@ -334,11 +334,15 @@ gtk_open_with_dialog_response (GtkDialog *dialog,
                      gtk_tree_model_get (model, &iter,
                                          COLUMN_APP_INFO, &info,
                                          -1);
-                     if (g_app_info_equal (selected, info))
+                     if (info != NULL && g_app_info_equal (selected, info))
                        {
                          gtk_list_store_remove (self->priv->program_list_store, &iter);
+                         g_object_unref (info);
                          break;
                        }
+
+                     if (info != NULL)
+                       g_object_unref (info);
                    }
                  while (gtk_tree_model_iter_next (model, &iter));
                }